package com.atguigu.config;

import com.baomidou.mybatisplus.extension.plugins.OptimisticLockerInterceptor;
import com.baomidou.mybatisplus.extension.plugins.PaginationInterceptor;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 配置类
 * <P> Date: 2022/2/27:11:11
 * <P> Description:
 */
@Configuration
@MapperScan("com.atguigu.mapper")
public class MyConfig {
    //生成乐观锁插件
    @Bean
        public OptimisticLockerInterceptor  optimisticLockerInterceptor(){
            return new OptimisticLockerInterceptor();
        }

    /**
     * 分页插件
     */
    @Bean
    public PaginationInterceptor paginationInterceptor() {
        return new PaginationInterceptor();
    }

}
